package com.ysl.study.designpattern.createmode.abstractfactory;

import com.ysl.study.designpattern.createmode.simplefactory.ColorFactory;
import com.ysl.study.designpattern.createmode.simplefactory.ShapeFactory;

/**
 * All right reserved by QUICKSWAN. from 2012
 *
 * @author yangshanlin
 * @date 2023/2/17 15:35
 * @describe
 */
public class FactoryProducer {

    public AbstractFactory getAbstractFactory(String type) {
        AbstractFactory abstractFactory = null;
        if (type.equals("shape")){
            abstractFactory = new ShapeFactory();
        } else if (type.equals("color")){
            abstractFactory = new ColorFactory();
        }
        return abstractFactory;
    }
}
